/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gui;

import java.awt.Color;
import java.util.ArrayList;
import javax.swing.AbstractListModel;
import javax.swing.ListModel;
import javax.swing.event.ListDataListener;
import javax.swing.tree.TreePath;
import org.math.plot.plots.Plot;

/**
 *
 * @author minaev
 */
public class LegendListModel extends AbstractListModel<Object> {

    ArrayList<TreePath> added_funcs;

    public LegendListModel(ArrayList<TreePath> added_funcs) {
        this.added_funcs = added_funcs;
    }
    
    
    
    @Override
    public int getSize() {
        return added_funcs.size();
    }

    @Override
    public Object getElementAt(int index) {
        String rt_string="";
        for(Object obj:added_funcs.get(index).getPath()){
            rt_string+=obj.toString()+">";
        }
        rt_string=rt_string.substring(0, rt_string.length()-2);
        return rt_string;
    }
    
}
